package svc

import (
	"go-zero-demo/app/datacenter/cron/internal/config"
	"go-zero-demo/pkg/gorm/mysql"
	"gorm.io/gorm"
)

type MigrateSvc struct {
	Config config.Config
	//Redis  *redis.Redis
	DB *gorm.DB
	//logx.Logger
}

func NewMigrateSvc(c config.Config) *MigrateSvc {
	db, err := mysql.New(c.MySQL)
	if err != nil {
		panic(err)
	}

	return &MigrateSvc{
		Config: c,
		//Redis:  redis.MustNewRedis(c.Redis),
		DB: db,
		//Logger: logx.WithContext(context.Background()),
	}
}
